local ActorBase = class("ActorBase")
local GameUtils = require("utils.GameUtils")

function ActorBase:ctor(manager, id, object)
    self._manager = manager
    self._id = id
    self._isDie = false
    self._isCall = false
    local gameObject = GameUtils.instantiate(object)
    local luaBehaviour = gameObject:AddComponent(typeof(CS.LuaBehaviour))
    luaBehaviour:SetScriptEnv(self)
end

function ActorBase:setCall(isCall)
    self._isCall = isCall
end

function ActorBase:isCall()
    return self._isCall
end

function ActorBase:getId()
    return self._id
end

function ActorBase:setCamp(camp)
    self._camp = camp
end

function ActorBase:setStanding(row, col)
    self._row = row
    self._col = col
end

function ActorBase:getCamp()
    return self._camp
end

function ActorBase:getRow()
    return self._row
end

function ActorBase:getCol()
    return self._col
end

function ActorBase:setBloodValue(value, maxBlood, isDie)
    self:setDie(isDie)
end

function ActorBase:subBlood(hurt)
    self:setDie(hurt.die)
end

function ActorBase:setDie(die)
    self._isDie = die
    self.gameObject:SetActive(not die)
    if die then
        self._manager:recycleActor(self._id)
    end
end

function ActorBase:isDie()
    return self._isDie
end

function ActorBase:delete()
    GameUtils.destroy(self.gameObject)
end

function ActorBase:playAction()
end

function ActorBase:setMoving()
end

function ActorBase:getManager()
    return self._manager
end

function ActorBase:getAnimationLength(animName)
    return 0
end

return ActorBase
